<?php 


/** 
***************************************************
*欢迎使用免费版xSite企业自助建站软件！
*这是一个专业为搜索引擎营销而设计的，极稳定、极易维护的建站软件！
*官方客服：help@php.net.cn
*官方下载网址：http://www.php.net.cn/xsite/ 
***************************************************
**/




if(!defined('IN_SITETEAM')) { exit('Access Denied'); } if (!empty($_POST['dosubmit'])) { $page_info_file = $user_data_dir . "/{$category}/index.txt"; if (!empty($_FILES['ptitle']['name'])) { if (!in_array($_FILES['ptitle']['type'], array("image/pjpeg", "image/gif", "image/jpeg", "image/png", "image/jpg"))) { message("xsite.php?action=page&operation=edit&category={$category}", "你所上传的图片格式不正确！请按说明上传"); } } $indexdata = $savedata = $_POST['data']; $savedata['content'] = stripslashes($savedata['content']); $key = time(); if ($auto_image == 1) { if(!file_exists("{$user_upload_dir}/public")) mkdir("{$user_upload_dir}/public"); $savedata['content'] = get_html_images($savedata['content'], "{$user_upload_dir}/public"); } if (isset($_POST['del_file']) && is_array($_POST['del_file']) && count($_POST['del_file'])) { if (array_key_exists('ptitle', $_POST['del_file'])) { if (file_exists($savedata['ptitle']) && preg_match("/^attachments/i", $savedata['ptitle'])) @unlink($savedata['ptitle']); $savedata['ptitle'] = ''; } } if (!empty($_FILES['ptitle']['name'])) { $fileinfo = upload_images('ptitle', $user_page_upload_dir, 0); if (is_array($fileinfo) && array_key_exists('name', $fileinfo) && array_key_exists('path', $fileinfo)) { if (!empty($savedata['ptitle'])) { if (file_exists($savedata['ptitle'])) { @unlink($savedata['ptitle']); } } $savedata['ptitle'] = str_replace(SITE_DIR . '/', '', "{$fileinfo['path']}{$fileinfo['name']}"); } } if (!file_exists($user_data_dir . "/{$category}")) { mkdir($user_data_dir . "/{$category}"); } save_array_file($savedata, $page_info_file); if (defined('XSITE_MU') && defined('SITE_HOST')) { $db->query("UPDATE xsite_cloud SET site_liveness = site_liveness + 1, site_action_time = '" . time() . "' WHERE site_id = '{$site_id}'"); } message("xsite.php?action=nav&operation=category", '单页信息编辑成功'); } else { $default_structure_file = SITE_ROOT . "/data/default.page.structure.txt"; $default_structure = read_array_file($default_structure_file); $diy_structure_file = $user_data_dir . "/page.structure.txt"; if (file_exists($diy_structure_file)) { $diy_structure = read_array_file($diy_structure_file); $forum_structure = array_merge($default_structure, $diy_structure); } else { $forum_structure = $default_structure; } if (file_exists($user_data_dir . "/{$category}/index.txt")) { $page_info_file = $user_data_dir . "/{$category}/index.txt"; $page_info = read_array_file($page_info_file); if (is_array($page_info) && count($page_info) > 0) foreach ($page_info as $k => $v) { if (array_key_exists($k, $forum_structure)) $forum_structure[$k]['value'] = $v; } } foreach ($forum_structure as $k => $v) { $form[$v['formtype']][$k] = $forum_structure[$k]; } extract($form); if (isset($content['content']['name'])) { $content['content']['name'] .= '<a style="cursor:hand" onclick="create_editor(\'content\');">[开]</a><a style="cursor:hand" onclick="close_editor();">[关]</a><a target="_blank" href="http://www.webps.cn">[图]</a>'; } include SITE_ROOT . "/admin/tpl/page_edit.tpl.php"; } ?>